package com.zx.mes.upms.hyl.rest;

import com.zx.mes.hyl.common.msg.ObjectRestResponse;
import com.zx.mes.hyl.common.rest.BaseController;
import com.zx.mes.upms.hyl.biz.MenuBiz;
import com.zx.mes.upms.hyl.biz.RoleMenuBiz;
import com.zx.mes.upms.hyl.entity.Menu;

import com.zx.mes.upms.hyl.entity.Role;
import com.zx.mes.upms.hyl.entity.RoleMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * 
 *
 * @author hyl
 * @email 632105841@qq.com
 * @date 2018-04-08 15:10:44
 */
@Controller
@RequestMapping("menu")
public class MenuController extends BaseController<MenuBiz,Menu> {

    @Autowired
    private RoleMenuBiz roleMenuBiz;

    @Override
    public ObjectRestResponse<Menu> remove(@PathVariable String id) {
        RoleMenu roleMenu = new RoleMenu();
        roleMenu.setMenuId(id);
        roleMenuBiz.delete(roleMenu);

        return super.remove(id);
    }
}